import { createSlice } from "@reduxjs/toolkit";
const initialState = {
    collapsed: false,
}
export const Collapsed = createSlice({
    // 调用名称,标识名称
    name: "iscollapsed",
    // 初始化状态值
    initialState,
    // 执行过程,actions
    reducers: {
        changeCollapsed: (state, actions) => {
            // state = !actions.payload
            // return state.collapsed = !state.collapsed
            // console.log(state, actions);
            // return state.collapsed = !state.collapsed
            if (actions.type) {
                state.collapsed = !state.collapsed
            }
            return state
        }
    }
})
const { actions, reducer } = Collapsed
export const { changeCollapsed } = actions;
export default reducer;